package com.review.study;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class SocketOperation {
    public static void main(String[] args) {
        try {
            //本地的ip就是127.0.0.1
            Socket socket = new Socket("127.0.0.1", 8769);
            OutputStream outputStream = socket.getOutputStream();
            outputStream.write("hello".getBytes());
            socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
